<?php

use Illuminate\Support\Facades\Route;

use App\Http\Controllers\Admin\PublicController;
use App\Http\Controllers\Admin\IndexController;
use App\Http\Controllers\Admin\ManagerController;
use App\Http\Controllers\Admin\AuthController;
use App\Http\Controllers\Admin\RoleController;
use App\Http\Controllers\Admin\MemberController;
use App\Http\Controllers\Admin\UploaderController;
use App\Http\Controllers\Admin\ArticleController;
use App\Http\Controllers\Home\HomeController;
use App\Http\Controllers\Home\NewsController;
use App\Http\Controllers\Home\ProductController;
use App\Http\Controllers\Admin\ProductsController;
use App\Http\Controllers\Home\AboutusController;
use App\Http\Controllers\Admin\PictureController;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/





//登录路由
Route::group(['prefix'=>'admin'],function(){
	Route::get('public/login',[PublicController::class , 'login'])->name('login');
	Route::get('public/logout',[PublicController::class , 'logout']);

	Route::post('public/check',[PublicController::class , 'check']);


	

});

//后台路由
Route::group(['prefix'=>'admin','middleware'=>['auth:admin','checkrbac']],function(){

	Route::get('index/index',[IndexController::class , 'index']);
	Route::get('index/welcome',[IndexController::class , 'welcome']);
	Route::get('manager/index',[ManagerController::class , 'index']);

	Route::get('auth/index',[AuthController::class , 'index']);
	Route::any('auth/add',[AuthController::class , 'add']);
	Route::get('role/index',[RoleController::class , 'index']);
	Route::any('role/assign',[RoleController::class , 'assign']);

	Route::get('member/index',[MemberController::class , 'index']);
	Route::get('member/show',[MemberController::class , 'show']);
	Route::any('member/add',[MemberController::class , 'add']);
	Route::get('member/stop',[MemberController::class , 'stop']);
	Route::get('member/start',[MemberController::class , 'start']);
	Route::any('member/edit',[MemberController::class , 'edit']);
	Route::post('uploader/webuploader',[UploaderController::class , 'webuploader']);
	Route::get('article/index',[ArticleController::class , 'index']);
	Route::any('article/articleadd',[ArticleController::class , 'articleadd']);
	Route::any('article/articleedit',[ArticleController::class , 'articleedit']);
	Route::get('article/delete',[ArticleController::class , 'articledel']);
	Route::get('article/preview',[ArticleController::class , 'preview']);
	Route::get('article/articlesearch',[ArticleController::class , 'articlesearch']);
	Route::post('uploader/addArticleDeal',[ArticleController::class , 'addArticleDeal']);



	Route::any('article/category',[ArticleController::class , 'category']);
	Route::any('article/categoryadd',[ArticleController::class , 'categoryadd']);
	Route::get('article/categorydel',[ArticleController::class , 'categorydel']);
	Route::any('article/categoryedit',[ArticleController::class , 'categoryedit']);

	Route::get('article/start',[ArticleController::class , 'start']);
	Route::get('article/stop',[ArticleController::class , 'stop']);
	Route::get('products',[ProductsController::class , 'index']);
	Route::any('productsadd',[ProductsController::class , 'add']);

	Route::any('upload',[ProductsController::class , 'upload']);
	Route::any('thumbadd',[ProductsController::class , 'thumbadd']);
	Route::any('thumb',[ProductsController::class , 'thumb']);
	Route::any('edit',[ProductsController::class , 'edit']);
	Route::any('addpic',[ProductsController::class , 'addpic']);
	Route::get('deletepic',[ProductsController::class , 'deletepic']);
	Route::get('article/about',[ArticleController::class , 'about']);
	Route::any('article/aboutadd',[ArticleController::class , 'aboutadd']);
	Route::any('article/aboutedit',[ArticleController::class , 'aboutedit']);
	Route::get('article/people',[ArticleController::class , 'people']);
	Route::any('article/peopleadd',[ArticleController::class , 'peopleadd']);
	Route::any('article/peopleedit',[ArticleController::class , 'peopleedit']);
	Route::get('picture',[PictureController::class , 'index']);
	Route::any('picadd',[PictureController::class , 'picadd']);
	Route::any('uploadpic',[PictureController::class , 'uploadpic']);
	Route::get('products/del',[ProductsController::class , 'delproducts']);
	Route::get('procate',[ProductsController::class , 'procategory']);
	Route::any('procateadd',[ProductsController::class , 'procateadd']);

	


	
	
});




//前台路由

Route::get('/',[HomeController::class , 'index']);
Route::get('newscenter/news',[NewsController::class , 'news']);
Route::get('newscenter/news_info',[NewsController::class , 'news_info']);

Route::get('product',[ProductController::class , 'index']);
Route::get('product_info',[ProductController::class , 'productInfo']);
Route::get('about',[AboutusController::class , 'index']);
Route::get('people',[AboutusController::class , 'people']);
Route::get('pro_category',[ProductController::class , 'pro_category']);
Route::get('contactus',[AboutusController::class , 'contactus']);
